import touchstart from './directive-touchstart'
import touchmove from './directive-touchmove'
import touchend from './directive-touchend'
import Vue from 'vue'

const installTouchstart = function (Vue) {
  Vue.directive('touchstart', touchstart)
}

const installTouchmove = function (Vue) {
  Vue.directive('touchmove', touchmove)
}

const installTouchend = function (Vue) {
  Vue.directive('touchend', touchend)
}

if (!Vue.prototype.$isServer && window.Vue) {
  window.touchstart = touchstart
  window.touchmove = touchmove
  window.touchend = touchend
  Vue.use(installTouchstart)
  Vue.use(installTouchmove)
  Vue.use(installTouchend)
}

touchstart.install = installTouchstart
touchmove.install = installTouchmove
touchend.install = installTouchend

export { touchstart, touchmove, touchend }
